• Jiri Benc's avatar
    vxlan: set needed headroom correctly · e4f4ae66
    Jiri Benc authored
    commit 9dc2ad10 upstream.
    
    vxlan_setup is called when allocating the net_device, i.e. way before
    vxlan_newlink (or vxlan_dev_configure) is called. This means
    vxlan->default_dst is actually unset in vxlan_setup and the condition that
    sets needed_headroom always takes the else branch.
    
    Set the needed_headrom at the point when we have the information about
    the address family available.
    
    Fixes: e4c7ed41 ("vxlan: add ipv6 support")
    Fixes: 2853af6a ("vxlan: use dev->needed_headroom instead of dev->hard_header_len")
    CC: Cong Wang <cwang@twopensource.com>
    Signed-off-by: default avatarJiri Benc <jbenc@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    [ luis: backported to 3.16:
      - initialise needed_headrom in vxlan_newlink() instead of
        vxlan_dev_configure() ]
    Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
    e4f4ae66
vxlan.c 75.1 KB