if_gif.c (241610) | if_gif.c (249925) |
---|---|
1/* $FreeBSD: head/sys/net/if_gif.c 241610 2012-10-16 13:37:54Z glebius $ */ | 1/* $FreeBSD: head/sys/net/if_gif.c 249925 2013-04-26 12:50:32Z glebius $ */ |
2/* $KAME: if_gif.c,v 1.87 2001/10/19 08:50:27 itojun Exp $ */ 3 4/*- 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 407 unchanged lines hidden (view full) --- 417 418 } 419 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; 420 GIF_UNLOCK(sc); 421 return; 422} 423 424int | 2/* $KAME: if_gif.c,v 1.87 2001/10/19 08:50:27 itojun Exp $ */ 3 4/*- 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 407 unchanged lines hidden (view full) --- 417 418 } 419 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; 420 GIF_UNLOCK(sc); 421 return; 422} 423 424int |
425gif_output(ifp, m, dst, ro) 426 struct ifnet *ifp; 427 struct mbuf *m; 428 struct sockaddr *dst; 429 struct route *ro; | 425gif_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, 426 struct route *ro) |
430{ 431 struct gif_softc *sc = ifp->if_softc; 432 struct m_tag *mtag; 433 int error = 0; 434 int gif_called; 435 uint32_t af; 436#ifdef MAC 437 error = mac_ifnet_check_transmit(ifp, m); --- 39 unchanged lines hidden (view full) --- 477 error = ENOMEM; 478 goto end; 479 } 480 *(struct ifnet **)(mtag + 1) = ifp; 481 m_tag_prepend(m, mtag); 482 483 m->m_flags &= ~(M_BCAST|M_MCAST); 484 /* BPF writes need to be handled specially. */ | 427{ 428 struct gif_softc *sc = ifp->if_softc; 429 struct m_tag *mtag; 430 int error = 0; 431 int gif_called; 432 uint32_t af; 433#ifdef MAC 434 error = mac_ifnet_check_transmit(ifp, m); --- 39 unchanged lines hidden (view full) --- 474 error = ENOMEM; 475 goto end; 476 } 477 *(struct ifnet **)(mtag + 1) = ifp; 478 m_tag_prepend(m, mtag); 479 480 m->m_flags &= ~(M_BCAST|M_MCAST); 481 /* BPF writes need to be handled specially. */ |
485 if (dst->sa_family == AF_UNSPEC) { | 482 if (dst->sa_family == AF_UNSPEC) |
486 bcopy(dst->sa_data, &af, sizeof(af)); | 483 bcopy(dst->sa_data, &af, sizeof(af)); |
487 dst->sa_family = af; 488 } 489 af = dst->sa_family; | 484 else 485 af = dst->sa_family; |
490 /* 491 * Now save the af in the inbound pkt csum 492 * data, this is a cheat since we are using 493 * the inbound csum_data field to carry the 494 * af over to the gif_start() routine, avoiding 495 * using yet another mtag. 496 */ 497 m->m_pkthdr.csum_data = af; --- 579 unchanged lines hidden --- | 486 /* 487 * Now save the af in the inbound pkt csum 488 * data, this is a cheat since we are using 489 * the inbound csum_data field to carry the 490 * af over to the gif_start() routine, avoiding 491 * using yet another mtag. 492 */ 493 m->m_pkthdr.csum_data = af; --- 579 unchanged lines hidden --- |