1. 05 3月, 2006 4 次提交
  2. 28 2月, 2006 10 次提交
  3. 25 2月, 2006 2 次提交
  4. 24 2月, 2006 5 次提交
    • H
      [IPSEC]: Use TOS when doing tunnel lookups · 4da3089f
      Herbert Xu 提交于
      We should use the TOS because it's one of the routing keys.  It also
      means that we update the correct routing cache entry when PMTU occurs.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4da3089f
    • J
      [NET] ethernet: Fix first packet goes out with MAC 00:00:00:00:00:00 · f8d0e3f1
      Jamal Hadi Salim 提交于
      When you turn off ARP on a netdevice then the first packet always goes
      out with a dstMAC of all zeroes. This is because the first packet is
      used to resolve ARP entries. Even though the ARP entry may be resolved
      (I tried by setting a static ARP entry for a host i was pinging from),
      it gets overwritten by virtue of having the netdevice disabling ARP.
      
      Subsequent packets go out fine with correct dstMAC address (which may
      be why people have ignored reporting this issue).
      
      To cut the story short: 
      
      the culprit code is in net/ethernet/eth.c::eth_header()
      
      ----
              /*
               *      Anyway, the loopback-device should never use this
      function...
               */
      
              if (dev->flags & (IFF_LOOPBACK|IFF_NOARP))
              {
                      memset(eth->h_dest, 0, dev->addr_len);
                      return ETH_HLEN;
              }
      
      	if(daddr)
              {
                      memcpy(eth->h_dest,daddr,dev->addr_len);
                      return ETH_HLEN;
              }
      
      ----
      
      Note how the h_dest is being reset when device has IFF_NOARP.
      
      As a note:
      All devices including loopback pass a daddr. loopback in fact passes
      a 0 all the time ;-> 
      This means i can delete the check totaly or i can remove the IFF_NOARP
      
      Alexey says:
      --------------------
      I think, it was me who did this crap. It was so long ago I do not remember
      why it was made.
      
      I remember some troubles with dummy device. It tried to resolve
      addresses, apparently, without success and generated errors instead of
      blackholing. I think the problem was eventually solved at neighbour
      level.
      
      After some thinking I suspect the deletion of this chunk could change
      behaviour of some parts which do not use neighbour cache f.e. packet
      socket.
      
      I think safer approach would be to move this chunk after if (daddr).
      And the possibility to remove this completely could be analyzed later.
      --------------------
      
      Patch updated with Alexey's safer suggestions.
      Signed-off-by: NJamal Hadi Salim <hadi@cyberus.ca>
      Acked-by: NAlexey Kuznetsov <kuznet@ms2.inr.ac.ru>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f8d0e3f1
    • H
      [XFRM]: Eliminate refcounting confusion by creating __xfrm_state_put(). · 21380b81
      Herbert Xu 提交于
      We often just do an atomic_dec(&x->refcnt) on an xfrm_state object
      because we know there is more than 1 reference remaining and thus
      we can elide the heavier xfrm_state_put() call.
      
      Do this behind an inline function called __xfrm_state_put() so that is
      more obvious and also to allow us to more cleanly add refcount
      debugging later.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      21380b81
    • S
      [IPV4]: Fix garbage collection of multipath route entries · 85259878
      Suresh Bhogavilli 提交于
      When garbage collecting route cache entries of multipath routes
      in rt_garbage_collect(), entries were deleted from the hash bucket
      'i' while holding a spin lock on bucket 'k' resulting in a system
      hang.  Delete entries, if any, from bucket 'k' instead.
      Signed-off-by: NSuresh Bhogavilli <sbhogavilli@verisign.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      85259878
    • P
      [NETFILTER]: Fix bridge netfilter related in xfrm_lookup · 42cf93cd
      Patrick McHardy 提交于
      The bridge-netfilter code attaches a fake dst_entry with dst->ops == NULL
      to purely bridged packets. When these packets are SNATed and a policy
      lookup is done, xfrm_lookup crashes because it tries to dereference
      dst->ops.
      
      Change xfrm_lookup not to dereference dst->ops before checking for the
      DST_NOXFRM flag and set this flag in the fake dst_entry.
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      42cf93cd
  5. 20 2月, 2006 4 次提交
    • Y
      [NET]: NETFILTER: remove duplicated lines and fix order in skb_clone(). · a8372f03
      YOSHIFUJI Hideaki 提交于
      Some of netfilter-related members are initalized / copied twice in
      skb_clone(). Remove one.
      
      Pointed out by Olivier MATZ <olivier.matz@6wind.com>.
      
      And this patch also fixes order of copying / clearing members.
      Signed-off-by: NYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a8372f03
    • P
      [NETFILTER]: Fix outgoing redirects to loopback · 8e249f08
      Patrick McHardy 提交于
      When redirecting an outgoing packet to loopback, it keeps the original
      conntrack reference and information from the outgoing path, which
      falsely triggers the check for DNAT on input and the dst_entry is
      released to trigger rerouting. ip_route_input refuses to route the
      packet because it has a local source address and it is dropped.
      
      Look at the packet itself to dermine if it was NATed. Also fix a
      missing inversion that causes unneccesary xfrm lookups.
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8e249f08
    • P
      [NETFILTER]: Fix NAT PMTUD problems · bc6e14b6
      Patrick McHardy 提交于
      ICMP errors are only SNATed when their source matches the source of the
      connection they are related to, otherwise the source address is not
      changed. This creates problems with ICMP frag. required messages
      originating from a router behind the NAT, if private IPs are used the
      packet has a good change of getting dropped on the path to its destination.
      
      Always NAT ICMP errors similar to the original connection.
      
      Based on report by Al Viro.
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bc6e14b6
    • P
      [XFRM]: Fix policy double put · 99511014
      Patrick McHardy 提交于
      The policy is put once immediately and once at the error label, which results
      in the following Oops:
      
      kernel BUG at net/xfrm/xfrm_policy.c:250!
      invalid opcode: 0000 [#2]
      PREEMPT
      [...]
      CPU:    0
      EIP:    0060:[<c028caf7>]    Not tainted VLI
      EFLAGS: 00210246   (2.6.16-rc3 #39)
      EIP is at __xfrm_policy_destroy+0xf/0x46
      eax: d49f2000   ebx: d49f2000   ecx: f74bd880   edx: f74bd280
      esi: d49f2000   edi: 00000001   ebp: cd506dcc   esp: cd506dc8
      ds: 007b   es: 007b   ss: 0068
      Process ssh (pid: 31970, threadinfo=cd506000 task=cfb04a70)
      Stack: <0>cd506000 cd506e34 c028e92b ebde7280 cd506e58 cd506ec0 f74bd280 00000000
             00000214 0000000a 0000000a 00000000 00000002 f7ae6000 00000000 cd506e58
             cd506e14 c0299e36 f74bd280 e873fe00 c02943fd cd506ec0 ebde7280 f271f440
      Call Trace:
       [<c0103a44>] show_stack_log_lvl+0xaa/0xb5
       [<c0103b75>] show_registers+0x126/0x18c
       [<c0103e68>] die+0x14e/0x1db
       [<c02b6809>] do_trap+0x7c/0x96
       [<c0104237>] do_invalid_op+0x89/0x93
       [<c01035af>] error_code+0x4f/0x54
       [<c028e92b>] xfrm_lookup+0x349/0x3c2
       [<c02b0b0d>] ip6_datagram_connect+0x317/0x452
       [<c0281749>] inet_dgram_connect+0x49/0x54
       [<c02404d2>] sys_connect+0x51/0x68
       [<c0240928>] sys_socketcall+0x6f/0x166
       [<c0102aa1>] syscall_call+0x7/0xb
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      99511014
  6. 19 2月, 2006 1 次提交
  7. 16 2月, 2006 6 次提交
  8. 15 2月, 2006 2 次提交
  9. 14 2月, 2006 6 次提交