source: trunk/target/linux/generic/patches-2.6.31/300-ipv6_accept_ra_when_forwarding.patch @ 24195

Last change on this file since 24195 was 24195, checked in by jow, 6 years ago

[kernel] backport two changes from kernel.org:
65e9b62d4503849b10bedfc29bff0473760cc597
ipv6: add special mode accept_ra=2 to accept RA while configured as router

c3bccac2fa76f1619dfe4fb7b9bee69de7f066d8
ipv6: add special mode forwarding=2 to send RS while configured as router

File size: 789 bytes
  • net/ipv6/ndisc.c

    a b errout: 
    11061106        rtnl_set_sk_err(net, RTNLGRP_ND_USEROPT, err); 
    11071107} 
    11081108 
     1109static inline int accept_ra(struct inet6_dev *in6_dev) 
     1110{ 
     1111        /* 
     1112         * If forwarding is enabled, RA are not accepted unless the special 
     1113         * hybrid mode (accept_ra=2) is enabled. 
     1114         */ 
     1115        if (in6_dev->cnf.forwarding && in6_dev->cnf.accept_ra < 2) 
     1116                return 0; 
     1117 
     1118        return in6_dev->cnf.accept_ra; 
     1119} 
     1120 
    11091121static void ndisc_router_discovery(struct sk_buff *skb) 
    11101122{ 
    11111123        struct ra_msg *ra_msg = (struct ra_msg *)skb_transport_header(skb); 
    static void ndisc_router_discovery(struc 
    11511163                           skb->dev->name); 
    11521164                return; 
    11531165        } 
    1154         if (in6_dev->cnf.forwarding || !in6_dev->cnf.accept_ra) { 
     1166        if (!accept_ra(in6_dev)) { 
    11551167                in6_dev_put(in6_dev); 
    11561168                return; 
    11571169        } 
Note: See TracBrowser for help on using the repository browser.