diff -ruN edgeos-vyatta-dhcp.orig/common/discover.c edgeos-vyatta-dhcp/common/discover.c --- edgeos-vyatta-dhcp.orig/common/discover.c 2020-08-03 10:37:10.794280519 +0200 +++ edgeos-vyatta-dhcp/common/discover.c 2020-08-03 10:40:03.836964508 +0200 @@ -248,6 +248,10 @@ return 0; } + /* Set Kernel Priority to 6 */ + int val = 6; + setsockopt(ifaces->sock, SOL_SOCKET, SO_PRIORITY, &val, sizeof(val)) + memset(&lifnum, 0, sizeof(lifnum)); #ifdef ISC_PLATFORM_HAVELIFNUM lifnum.lifn_family = AF_UNSPEC; diff -ruN edgeos-vyatta-dhcp.orig/common/icmp.c edgeos-vyatta-dhcp/common/icmp.c --- edgeos-vyatta-dhcp.orig/common/icmp.c 2020-08-03 10:37:10.798280441 +0200 +++ edgeos-vyatta-dhcp/common/icmp.c 2020-08-03 10:41:14.840139568 +0200 @@ -95,6 +95,10 @@ return; } + /* Set Kernel Priority to 6 */ + int val = 6; + setsockopt(icmp_state -> socket, SOL_SOCKET, SO_PRIORITY, &val, sizeof(val)); + #if defined (HAVE_SETFD) if (fcntl (icmp_state -> socket, F_SETFD, 1) < 0) log_error ("Can't set close-on-exec on icmp: %m"); diff -ruN edgeos-vyatta-dhcp.orig/common/lpf.c edgeos-vyatta-dhcp/common/lpf.c --- edgeos-vyatta-dhcp.orig/common/lpf.c 2020-08-03 10:37:10.798280441 +0200 +++ edgeos-vyatta-dhcp/common/lpf.c 2020-08-03 10:43:42.834299280 +0200 @@ -89,6 +89,12 @@ log_fatal ("Open a socket for LPF: %m"); } + + /* Set Kernel Priority to 6 */ + int val; + val = 6; + setsockopt(sock, SOL_SOCKET, SO_PRIORITY, &val, sizeof(val)); + memset (&ifr, 0, sizeof ifr); strncpy (ifr.ifr_name, (const char *)info -> ifp, sizeof ifr.ifr_name); ifr.ifr_name[IFNAMSIZ-1] = '\0'; @@ -495,6 +501,10 @@ log_fatal("Can't create socket for \"%s\": %m", name); } + /* Set Kernel Priority to 6 */ + int val = 6; + setsockopt(sock, SOL_SOCKET, SO_PRIORITY, &val, sizeof(val)); + memset(&tmp, 0, sizeof(tmp)); strcpy(tmp.ifr_name, name); if (ioctl(sock, SIOCGIFHWADDR, &tmp) < 0) { diff -ruN edgeos-vyatta-dhcp.orig/common/raw.c edgeos-vyatta-dhcp/common/raw.c --- edgeos-vyatta-dhcp.orig/common/raw.c 2020-08-03 10:37:10.802280362 +0200 +++ edgeos-vyatta-dhcp/common/raw.c 2020-08-03 11:02:03.053682131 +0200 @@ -66,6 +66,10 @@ if ((sock = socket (AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0) log_fatal ("Can't create dhcp socket: %m"); + /* Set Kernel Priority to 6 */ + int val = 6; + setsockopt(sock, SOL_SOCKET, SO_PRIORITY, &val, sizeof(val)); + /* Set the BROADCAST option so that we can broadcast DHCP responses. */ flag = 1; if (setsockopt (sock, SOL_SOCKET, SO_BROADCAST, diff -ruN edgeos-vyatta-dhcp.orig/common/socket.c edgeos-vyatta-dhcp/common/socket.c --- edgeos-vyatta-dhcp.orig/common/socket.c 2020-08-03 10:37:10.802280362 +0200 +++ edgeos-vyatta-dhcp/common/socket.c 2020-08-03 10:48:10.782912522 +0200 @@ -189,6 +189,10 @@ log_fatal("Can't create dhcp socket: %m"); } + /* Set Kernel Priority to 6 */ + int val = 6; + setsockopt(sock, SOL_SOCKET, SO_PRIORITY, &val, sizeof(val)); + /* Set the REUSEADDR option so that we don't fail to start if we're being restarted. */ flag = 1; @@ -1172,8 +1176,12 @@ log_fatal("Couldn't get interface flags for %s: %m", name); } - + flag_check: + /* Set Kernel Priority to 6 */ + int val = 6; + setsockopt(sock, SOL_SOCKET, SO_PRIORITY, &val, sizeof(val)); + if (lifr.lifr_flags & (IFF_VIRTUAL|IFF_IPMP)) { hw->hlen = sizeof (hw->hbuf); srandom((long)gethrtime()); diff -ruN edgeos-vyatta-dhcp.orig/minires/res_send.c edgeos-vyatta-dhcp/minires/res_send.c --- edgeos-vyatta-dhcp.orig/minires/res_send.c 2020-08-03 10:37:10.878278872 +0200 +++ edgeos-vyatta-dhcp/minires/res_send.c 2020-08-03 10:52:08.309330683 +0200 @@ -375,6 +375,11 @@ "socket(vc)", errno); return (-1); } + + /* Set Kernel Priority to 6 */ + int val = 6; + setsockopt(statp->_sock, SOL_SOCKET, SO_PRIORITY, &val, sizeof(val)); + errno = 0; if (connect(statp->_sock, (struct sockaddr *)nsap, @@ -533,6 +538,11 @@ "socket(dg)", errno); return terrno; } + + /* Set Kernel Priority to 6 */ + int val = 6; + setsockopt(statp->_sock, SOL_SOCKET, SO_PRIORITY, &val, sizeof(val)); + statp->_flags &= ~RES_F_CONN; } #ifndef CANNOT_CONNECT_DGRAM @@ -600,6 +610,11 @@ len = sizeof(local_addr); s1 = socket(PF_INET, SOCK_DGRAM, 0); + + /* Set Kernel Priority to 6 */ + int val = 6; + setsockopt(s1, SOL_SOCKET, SO_PRIORITY, &val, sizeof(val)); + result = getsockname(statp->_sock, (struct sockaddr *)&local_addr, &len); diff -ruN edgeos-vyatta-dhcp.orig/omapip/connection.c edgeos-vyatta-dhcp/omapip/connection.c --- edgeos-vyatta-dhcp.orig/omapip/connection.c 2020-08-03 10:37:10.882278793 +0200 +++ edgeos-vyatta-dhcp/omapip/connection.c 2020-08-03 10:53:22.575661898 +0200 @@ -147,6 +147,10 @@ return ISC_R_UNEXPECTED; } + /* Set Kernel Priority to 6 */ + int val = 6; + setsockopt(obj -> socket, SOL_SOCKET, SO_PRIORITY, &val, sizeof(val)); + /* Set up the local address, if any. */ if (local_addr) { /* Only do TCPv4 so far. */ diff -ruN edgeos-vyatta-dhcp.orig/omapip/listener.c edgeos-vyatta-dhcp/omapip/listener.c --- edgeos-vyatta-dhcp.orig/omapip/listener.c 2020-08-03 10:37:10.886278715 +0200 +++ edgeos-vyatta-dhcp/omapip/listener.c 2020-08-03 10:54:06.269048115 +0200 @@ -126,6 +126,10 @@ goto error_exit; } + /* Set Kernel Priority to 6 */ + int val = 6; + setsockopt(obj -> socket, SOL_SOCKET, SO_PRIORITY, &val, sizeof(val)); + #if defined (HAVE_SETFD) if (fcntl (obj -> socket, F_SETFD, 1) < 0) { status = ISC_R_UNEXPECTED; diff -ruN edgeos-vyatta-dhcp.orig/omapip/mrtrace.c edgeos-vyatta-dhcp/omapip/mrtrace.c --- edgeos-vyatta-dhcp.orig/omapip/mrtrace.c 2020-08-03 10:37:10.886278715 +0200 +++ edgeos-vyatta-dhcp/omapip/mrtrace.c 2020-08-03 10:57:30.471982584 +0200 @@ -343,10 +343,17 @@ int trace_mr_socket (int domain, int type, int protocol) { #if defined (TRACING) - if (!trace_playback ()) + if (!trace_playback ()) { #endif - return socket (domain, type, protocol); + int sock = socket (domain, type, protocol); + + /* Set Kernel Priority to 6 */ + int val = 6; + setsockopt(sock, SOL_SOCKET, SO_PRIORITY, &val, sizeof(val)); + + return sock; #if defined (TRACING) + } return 100; #endif }