Skip to content
Snippets Groups Projects
Select Git revision
  • 2fdd3af1cc497be7e28c40cf6465fdac804e46c5
  • experimental
  • master
  • v2021.1.2-ffs
  • v2021.1.1-ffs
  • nrb/gluon-master-cpe510
  • v2021.1-ffs
  • v2020.2.3-ffs
  • nrbffs/fastd-remove-delay
  • v2020.2.2-ffs
  • v2020.2.1-ffs
  • v2020.2-ffs
  • v2020.2.x
  • v2020.1.3-ffs
  • v2020.1.1-ffs
  • v2020.1-ffs
  • v2019.1.2-ffs
  • v2019.1.1-ffs
  • nrb/test-radv-filter
  • v2019.1-ffs
  • nrbffs/netgear-ex6120
  • v2021.1.2-ffs0.2
  • v2021.1.2-ffs0.1
  • v2021.1.1-ffs0.4
  • v2021.1.1-ffs0.3
  • v2021.1.1-ffs0.2
  • v2021.1.1-ffs0.1
  • v2021.1-ffs0.1
  • v2020.2.3-ffs0.3
  • v2020.2.3-ffs0.2
  • v2020.2.3-ffs0.1
  • v2020.2.2-ffs0.1
  • v2020.2.1-ffs0.1
  • v2020.2-ffs0.1
  • v2020.2
  • v2020.2.x-ffs0.1
  • v2020.1.3-ffs0.1
  • v2020.1.1-ffs0.1
  • v2020.1-ffs0.1
  • v2019.1.2-ffs0.1
  • v2019.1.1-ffs0.1
41 results

0030-dnsmasq-add-patch-to-allow-setting-the-default-packet-mark.patch

Blame
  • Forked from firmware / FFS Gluon
    Source project has a limited visibility.
    0030-dnsmasq-add-patch-to-allow-setting-the-default-packet-mark.patch 3.71 KiB
    From: Matthias Schiffer <mschiffer@universe-factory.net>
    Date: Sun, 6 Jul 2014 08:12:35 +0200
    Subject: dnsmasq: add patch to allow setting the default packet mark
    
    diff --git a/package/dnsmasq/patches/901-packet-mark.patch b/package/dnsmasq/patches/901-packet-mark.patch
    new file mode 100644
    index 0000000..286af3a
    --- /dev/null
    +++ b/package/dnsmasq/patches/901-packet-mark.patch
    @@ -0,0 +1,103 @@
    +--- a/src/dnsmasq.h
    ++++ b/src/dnsmasq.h
    +@@ -802,6 +802,7 @@ extern struct daemon {
    +   int cachesize, ftabsize;
    +   int port, query_port, min_port;
    +   unsigned long local_ttl, neg_ttl, max_ttl, max_cache_ttl, auth_ttl;
    ++  unsigned int packet_mark;
    +   struct hostsfile *addn_hosts;
    +   struct dhcp_context *dhcp, *dhcp6;
    +   struct dhcp_config *dhcp_conf;
    +--- a/src/forward.c
    ++++ b/src/forward.c
    +@@ -366,17 +366,17 @@ static int forward_query(int udpfd, unio
    + 		      daemon->rfd_save = forward->rfd4;
    + 		      fd = forward->rfd4->fd;
    + 		    }
    ++		}
    ++
    ++	      unsigned int mark = daemon->packet_mark;
    + 
    + #ifdef HAVE_CONNTRACK
    +-		  /* Copy connection mark of incoming query to outgoing connection. */
    +-		  if (option_bool(OPT_CONNTRACK))
    +-		    {
    +-		      unsigned int mark;
    +-		      if (get_incoming_mark(udpaddr, dst_addr, 0, &mark))
    +-			setsockopt(fd, SOL_SOCKET, SO_MARK, &mark, sizeof(unsigned int));
    +-		    }
    ++	      /* Copy connection mark of incoming query to outgoing connection. */
    ++	      if (option_bool(OPT_CONNTRACK))
    ++		get_incoming_mark(udpaddr, dst_addr, 0, &mark);
    + #endif
    +-		}
    ++
    ++	      setsockopt(fd, SOL_SOCKET, SO_MARK, &mark, sizeof(unsigned int));
    + 	      
    + 	      if (sendto(fd, (char *)header, plen, 0,
    + 			 &start->addr.sa,
    +@@ -1001,11 +1001,11 @@ unsigned char *tcp_request(int confd, ti
    + 			      continue;
    + 			    }
    + 			  
    ++			  unsigned int mark = daemon->packet_mark;
    + #ifdef HAVE_CONNTRACK
    + 			  /* Copy connection mark of incoming query to outgoing connection. */
    + 			  if (option_bool(OPT_CONNTRACK))
    + 			    {
    +-			      unsigned int mark;
    + 			      struct all_addr local;
    + #ifdef HAVE_IPV6		      
    + 			      if (local_addr->sa.sa_family == AF_INET6)
    +@@ -1014,10 +1014,11 @@ unsigned char *tcp_request(int confd, ti
    + #endif
    + 				local.addr.addr4 = local_addr->in.sin_addr;
    + 			      
    +-			      if (get_incoming_mark(&peer_addr, &local, 1, &mark))
    +-				setsockopt(last_server->tcpfd, SOL_SOCKET, SO_MARK, &mark, sizeof(unsigned int));
    ++			      get_incoming_mark(&peer_addr, &local, 1, &mark);
    + 			    }
    + #endif