]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
Merge branch 'iproute2-master' into iproute2-next
authorDavid Ahern <dsahern@gmail.com>
Fri, 4 Jan 2019 20:22:47 +0000 (12:22 -0800)
committerDavid Ahern <dsahern@gmail.com>
Fri, 4 Jan 2019 20:22:47 +0000 (12:22 -0800)
Conflicts:
ip/iprule.c

Signed-off-by: David Ahern <dsahern@gmail.com>
1  2 
ip/iprule.c
rdma/utils.c

diff --cc ip/iprule.c
index 6af71cab653479f3c467958f70d169fb7c963817,9a7173d007a047695e7e8a33fe8290505554317f..2f58d8c2acd8744839dcf103018362db1352159f
@@@ -177,39 -175,18 +178,51 @@@ static bool filter_nlmsg(struct nlmsghd
                        return false;
        }
  
 +      if (filter.ipproto) {
 +              __u8 ipproto = 0;
 +
 +              if (tb[FRA_IP_PROTO])
 +                      ipproto = rta_getattr_u8(tb[FRA_IP_PROTO]);
 +              if (filter.ipproto != ipproto)
 +                      return false;
 +      }
 +
 +      if (filter.sport.start) {
 +              const struct fib_rule_port_range *r;
 +
 +              if (!tb[FRA_SPORT_RANGE])
 +                      return false;
 +
 +              r = RTA_DATA(tb[FRA_SPORT_RANGE]);
 +              if (r->start != filter.sport.start ||
 +                  r->end != filter.sport.end)
 +                      return false;
 +      }
 +
 +      if (filter.dport.start) {
 +              const struct fib_rule_port_range *r;
 +
 +              if (!tb[FRA_DPORT_RANGE])
 +                      return false;
 +
 +              r = RTA_DATA(tb[FRA_DPORT_RANGE]);
 +              if (r->start != filter.dport.start ||
 +                  r->end != filter.dport.end)
 +                      return false;
 +      }
 +
+       if (filter.tun_id) {
+               __u64 tun_id = 0;
+               if (tb[FRA_TUN_ID]) {
+                       tun_id = ntohll(rta_getattr_u64(tb[FRA_TUN_ID]));
+                       if (filter.tun_id != tun_id)
+                               return false;
+               } else {
+                       return false;
+               }
+       }
        table = frh_get_table(frh, tb);
        if (filter.tb > 0 && filter.tb ^ table)
                return false;
diff --cc rdma/utils.c
Simple merge