diff options
author | rwatson <rwatson@FreeBSD.org> | 2009-06-24 10:32:44 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2009-06-24 10:32:44 +0000 |
commit | 16b92db4cdd4f185b371177716f4b58594612d20 (patch) | |
tree | 60dc81a23ac68fc8613f2da7a97b2b2686ff4459 /sys/net/if_ethersubr.c | |
parent | 8a1869e3472bc512675d15b029ba4987b23aff87 (diff) | |
download | FreeBSD-src-16b92db4cdd4f185b371177716f4b58594612d20.zip FreeBSD-src-16b92db4cdd4f185b371177716f4b58594612d20.tar.gz |
Break at_ifawithnet() into two variants:
- at_ifawithnet(), which acquires an locks it needs and returns an
at_ifaddr reference.
- at_ifawithnet_locked(), which relies on the caller locking
at_ifaddr_list, and returns a pointer rather than a reference.
Update various consumers to prefer one or the other, including ether
and fddi output, to properly release at_ifaddr references.
Rework at_control() to manage locking and references in a manner
identical to in_control().
MFC after: 6 weeks
Diffstat (limited to 'sys/net/if_ethersubr.c')
-rw-r--r-- | sys/net/if_ethersubr.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 5d536aa..5e98e53 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -261,14 +261,17 @@ ether_output(struct ifnet *ifp, struct mbuf *m, if ((aa = at_ifawithnet((struct sockaddr_at *)dst)) == NULL) senderr(EHOSTUNREACH); /* XXX */ - if (!aarpresolve(ifp, m, (struct sockaddr_at *)dst, edst)) + if (!aarpresolve(ifp, m, (struct sockaddr_at *)dst, edst)) { + ifa_free(&aa->aa_ifa); return (0); + } /* * In the phase 2 case, need to prepend an mbuf for the llc header. */ if ( aa->aa_flags & AFA_PHASE2 ) { struct llc llc; + ifa_free(&aa->aa_ifa); M_PREPEND(m, LLC_SNAPFRAMELEN, M_DONTWAIT); if (m == NULL) senderr(ENOBUFS); @@ -280,6 +283,7 @@ ether_output(struct ifnet *ifp, struct mbuf *m, type = htons(m->m_pkthdr.len); hlen = LLC_SNAPFRAMELEN + ETHER_HDR_LEN; } else { + ifa_free(&aa->aa_ifa); type = htons(ETHERTYPE_AT); } break; |