Skip to content
  1. Jul 05, 2016
    • Pavel Tikhomirov's avatar
      netfilter: nf_log: fix error on write NONE to logger choice sysctl · c6ac37d8
      Pavel Tikhomirov authored
      
      
      It is hard to unbind nf-logger:
      
        echo NONE > /proc/sys/net/netfilter/nf_log/0
        bash: echo: write error: No such file or directory
      
        sysctl -w net.netfilter.nf_log.0=NONE
        sysctl: setting key "net.netfilter.nf_log.0": No such file or directory
        net.netfilter.nf_log.0 = NONE
      
      You need explicitly send '\0', for instance like:
      
        echo -e "NONE\0" > /proc/sys/net/netfilter/nf_log/0
      
      That seem to be strange, so fix it using proc_dostring.
      
      Now it works fine:
         modprobe nfnetlink_log
         echo nfnetlink_log > /proc/sys/net/netfilter/nf_log/0
         cat /proc/sys/net/netfilter/nf_log/0
         nfnetlink_log
         echo NONE > /proc/sys/net/netfilter/nf_log/0
         cat /proc/sys/net/netfilter/nf_log/0
         NONE
      
      v2: add missed error check for proc_dostring
      
      Signed-off-by: default avatarPavel Tikhomirov <ptikhomirov@virtuozzo.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      c6ac37d8
  2. Jul 03, 2016
    • Joe Perches's avatar
      netfilter: Convert FWINV<[foo]> macros and uses to NF_INVF · c37a2dfa
      Joe Perches authored
      
      
      netfilter uses multiple FWINV #defines with identical form that hide a
      specific structure variable and dereference it with a invflags member.
      
      $ git grep "#define FWINV"
      include/linux/netfilter_bridge/ebtables.h:#define FWINV(bool,invflg) ((bool) ^ !!(info->invflags & invflg))
      net/bridge/netfilter/ebtables.c:#define FWINV2(bool, invflg) ((bool) ^ !!(e->invflags & invflg))
      net/ipv4/netfilter/arp_tables.c:#define FWINV(bool, invflg) ((bool) ^ !!(arpinfo->invflags & (invflg)))
      net/ipv4/netfilter/ip_tables.c:#define FWINV(bool, invflg) ((bool) ^ !!(ipinfo->invflags & (invflg)))
      net/ipv6/netfilter/ip6_tables.c:#define FWINV(bool, invflg) ((bool) ^ !!(ip6info->invflags & (invflg)))
      net/netfilter/xt_tcpudp.c:#define FWINVTCP(bool, invflg) ((bool) ^ !!(tcpinfo->invflags & (invflg)))
      
      Consolidate these macros into a single NF_INVF macro.
      
      Miscellanea:
      
      o Neaten the alignment around these uses
      o A few lines are > 80 columns for intelligibility
      
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      c37a2dfa
  3. Jul 01, 2016
  4. Jun 24, 2016
  5. Jun 23, 2016
  6. Jun 07, 2016
    • Florian Westphal's avatar
      netfilter: helper: avoid extra expectation iterations on unregister · 436a850d
      Florian Westphal authored
      
      
      The expectation table is not duplicated per net namespace anymore, so we can move
      the expectation table and conntrack table iteration out of the per-net loop.
      
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      436a850d
    • Tobin C Harding's avatar
      bridge: netfilter: checkpatch data type fixes · 402f9030
      Tobin C Harding authored
      
      
      checkpatch produces data type 'checks'.
      
      This patch amends them by changing, for example:
      uint8_t -> u8
      
      Signed-off-by: default avatarTobin C Harding <me@tobin.cc>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      402f9030
    • David S. Miller's avatar
      Merge branch 'vrf-local' · 2fb7ea45
      David S. Miller authored
      
      
      David Ahern says:
      
      ====================
      net: vrf: Add support for local traffic to local addresses
      
      Add support for locally originated traffic to VRF-local addresses,
      be it addresses on enslaved devices or addresses on the VRF device:
      
      $ ip addr show dev red
      33: red: <NOARP,MASTER,UP,LOWER_UP> mtu 65536 qdisc pfifo_fast state UP group default qlen 1000
          link/ether be:00:53:b5:e4:25 brd ff:ff:ff:ff:ff:ff
          inet 1.1.1.1/32 scope global red
             valid_lft forever preferred_lft forever
          inet6 1111:1::1/128 scope global
             valid_lft forever preferred_lft forever
      
      $ ip addr show dev eth1
      3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master red state UP group default qlen 1000
          link/ether 02:e0:f9:79:34:bd brd ff:ff:ff:ff:ff:ff
          inet 10.100.1.1/24 brd 10.100.1.255 scope global eth1
             valid_lft forever preferred_lft forever
          inet6 2100:1::1/120 scope global
             valid_lft forever preferred_lft forever
          inet6 fe80::e0:f9ff:fe79:34bd/64 scope link
             valid_lft forever preferred_lft forever
      
      $ ping -c1 -I red 10.100.1.1
          ping: Warning: source address might be selected on device other than red.
          PING 10.100.1.1 (10.100.1.1) from 10.100.1.1 red: 56(84) bytes of data.
          64 bytes from 10.100.1.1: icmp_seq=1 ttl=64 time=0.057 ms
      
      $ ping -c1 -I red 1.1.1.1
      PING 1.1.1.1 (1.1.1.1) from 1.1.1.1 red: 56(84) bytes of data.
      64 bytes from 1.1.1.1: icmp_seq=1 ttl=64 time=0.136 ms
      
      --- 1.1.1.1 ping statistics ---
      1 packets transmitted, 1 received, 0% packet loss, time 0ms
      rtt min/avg/max/mdev = 0.136/0.136/0.136/0.000 ms
      
      $ ping6 -c1 -I red  2100:1::1
      ping6: Warning: source address might be selected on device other than red.
      PING 2100:1::1(2100:1::1) from 2100:1::1 red: 56 data bytes
      64 bytes from 2100:1::1: icmp_seq=1 ttl=64 time=0.167 ms
      
      --- 2100:1::1 ping statistics ---
      1 packets transmitted, 1 received, 0% packet loss, time 0ms
      rtt min/avg/max/mdev = 0.167/0.167/0.167/0.000 ms
      
      $ ping6 -c1 -I red 1111::1
      PING 1111::1(1111::1) from 1111:1::1 red: 56 data bytes
      64 bytes from 1111::1: icmp_seq=1 ttl=64 time=0.187 ms
      
      --- 1111::1 ping statistics ---
      1 packets transmitted, 1 received, 0% packet loss, time 0ms
      rtt min/avg/max/mdev = 0.187/0.187/0.187/0.000 ms
      
      This change also enables use of loopback address on the VRF device:
      $ ip addr add dev red 127.0.0.1/8
      
      $ ping -c1 -I red 127.0.0.1
      PING 127.0.0.1 (127.0.0.1) from 127.0.0.1 red: 56(84) bytes of data.
      64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.058 ms
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2fb7ea45
    • David Ahern's avatar
      net: vrf: ipv6 support for local traffic to local addresses · 625b47b5
      David Ahern authored
      
      
      Add support for locally originated traffic to VRF-local IPv6 addresses.
      Similar to IPv4 a local dst is set on the skb and the packet is
      reinserted with a call to netif_rx. With this patch, ping, tcp and udp
      packets to a local IPv6 address are successfully routed:
      
          $ ip addr show dev eth1
          4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master red state UP group default qlen 1000
              link/ether 02:e0:f9:1c:b9:74 brd ff:ff:ff:ff:ff:ff
              inet 10.100.1.1/24 brd 10.100.1.255 scope global eth1
                 valid_lft forever preferred_lft forever
              inet6 2100:1::1/120 scope global
                 valid_lft forever preferred_lft forever
              inet6 fe80::e0:f9ff:fe1c:b974/64 scope link
                 valid_lft forever preferred_lft forever
      
          $ ping6 -c1 -I red 2100:1::1
          ping6: Warning: source address might be selected on device other than red.
          PING 2100:1::1(2100:1::1) from 2100:1::1 red: 56 data bytes
          64 bytes from 2100:1::1: icmp_seq=1 ttl=64 time=0.098 ms
      
      ip6_input is exported so the VRF driver can use it for the dst input
      function. The dst_alloc function for IPv4 defaults to setting the input and
      output functions; IPv6's does not. VRF does not need to duplicate the Rx path
      so just export the ipv6 input function.
      
      Signed-off-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      625b47b5
    • David Ahern's avatar
      net: vrf: ipv4 support for local traffic to local addresses · 671cd19a
      David Ahern authored
      
      
      Add support for locally originated traffic to VRF-local addresses. If
      destination device for an skb is the loopback or VRF device then set
      its dst to a local version of the VRF cached dst_entry and call netif_rx
      to insert the packet onto the rx queue - similar to what is done for
      loopback. This patch handles IPv4 support; follow on patch handles IPv6.
      
      With this patch, ping, tcp and udp packets to a local IPv4 address are
      successfully routed:
      
          $ ip addr show dev eth1
          4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master red state UP group default qlen 1000
              link/ether 02:e0:f9:1c:b9:74 brd ff:ff:ff:ff:ff:ff
              inet 10.100.1.1/24 brd 10.100.1.255 scope global eth1
                 valid_lft forever preferred_lft forever
              inet6 2100:1::1/120 scope global
                 valid_lft forever preferred_lft forever
              inet6 fe80::e0:f9ff:fe1c:b974/64 scope link
                 valid_lft forever preferred_lft forever
      
          $ ping -c1 -I red 10.100.1.1
          ping: Warning: source address might be selected on device other than red.
          PING 10.100.1.1 (10.100.1.1) from 10.100.1.1 red: 56(84) bytes of data.
          64 bytes from 10.100.1.1: icmp_seq=1 ttl=64 time=0.057 ms
      
      This patch also enables use of IPv4 loopback address on the VRF device:
          $ ip addr add dev red 127.0.0.1/8
      
          $ ping -c1 -I red 127.0.0.1
          PING 127.0.0.1 (127.0.0.1) from 127.0.0.1 red: 56(84) bytes of data.
          64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.058 ms
      
      Signed-off-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      671cd19a
    • David Ahern's avatar
      net: vrf: Minor refactoring for local address patches · 09fcf916
      David Ahern authored
      
      
      Move the stripping of the ethernet header from is_ip_tx_frame into the
      ipv4 and ipv6 outbound functions. If the packet is destined to a local
      address the header is retained since the packet is sent back to netif_rx.
      
      Collapse vrf_send_v4_prep into vrf_process_v4_outbound.
      
      Signed-off-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      09fcf916
  7. Jun 06, 2016
  8. Jun 05, 2016
    • David S. Miller's avatar
      Merge branch 'hns-acpi' · b1c6a3a4
      David S. Miller authored
      
      
      Kejian Yan says:
      
      ====================
      net: hns: add support of ACPI
      
      This series adds HNS support of acpi. The routine will call some ACPI
      helper functions, like acpi_dev_found() and acpi_evaluate_dsm(), which
      are not included in other cases. In order to make system compile
      successfully in other cases except ACPI, it needs to add relative stub
      functions to linux/acpi.h. And we use device property functions instead
      of serial helper functions to suport both DT and ACPI cases. And then
      add the supports of ACPI for HNS.
      
      change log:
       v3->v4:
        mii-id gets from dev-name instead of address
      
       v2->v3:
       1. add Review-by: Andy Shevchenko
       2. fix the potential memory leak
      
       v1 -> v2:
       1. use acpi_dev_found() instead of acpi_match_device_ids() to check if
      it is a acpi node.
       2. use is_of_node() instead of IS_ENABLED() to check if it is a DT node.
       3. split the patch("add support of acpi for hns-mdio") into two patches:
          3.1 Move to use fwnode_handle
          3.2 Add ACPI
       4. add the patch which subject is dsaf misc operation method
       5. fix the comments by Andy Shevchenko
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b1c6a3a4
    • Kejian Yan's avatar
      net: hns: net: hns: enet adds support of acpi · 63434888
      Kejian Yan authored
      
      
      Enet needs to get configration parameter by acpi. This patch
      adds support of ACPI for enet. The configuration parameter will
      be configed in BIOS.
      
      Signed-off-by: default avatarKejian Yan <yankejian@huawei.com>
      Signed-off-by: default avatarYisen Zhuang <Yisen.Zhuang@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      63434888
    • Kejian Yan's avatar
      net: hns: implement the miscellaneous operation by asl · f00ef863
      Kejian Yan authored
      
      
      The miscellaneous operation is implemented in BIOS, the kernel can call
      _DSM method help to call the implementation in ACPI case. Here is a patch
      to do that.
      
      Signed-off-by: default avatarKejian Yan <yankejian@huawei.com>
      Signed-off-by: default avatarYisen Zhuang <Yisen.Zhuang@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f00ef863