Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73523
b: refs/heads/master
c: 358352b
h: refs/heads/master
i:
  73521: 413a5b2
  73519: 673ef0d
v: v3
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Nov 11, 2007
1 parent addebbd commit 6fcb5a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 99f933263ac30eafbb008d01ac1dd0adf40fc343
refs/heads/master: 358352b8b83c67ecf75f6d7bc3e2d64bf0cf506a
11 changes: 7 additions & 4 deletions trunk/net/ipv4/tunnel4.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ static struct xfrm_tunnel *tunnel4_handlers;
static struct xfrm_tunnel *tunnel64_handlers;
static DEFINE_MUTEX(tunnel4_mutex);

static inline struct xfrm_tunnel **fam_handlers(unsigned short family)
{
return (family == AF_INET) ? &tunnel4_handlers : &tunnel64_handlers;
}

int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short family)
{
struct xfrm_tunnel **pprev;
Expand All @@ -25,8 +30,7 @@ int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short family)

mutex_lock(&tunnel4_mutex);

for (pprev = (family == AF_INET) ? &tunnel4_handlers : &tunnel64_handlers;
*pprev; pprev = &(*pprev)->next) {
for (pprev = fam_handlers(family); *pprev; pprev = &(*pprev)->next) {
if ((*pprev)->priority > priority)
break;
if ((*pprev)->priority == priority)
Expand All @@ -53,8 +57,7 @@ int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler, unsigned short family)

mutex_lock(&tunnel4_mutex);

for (pprev = (family == AF_INET) ? &tunnel4_handlers : &tunnel64_handlers;
*pprev; pprev = &(*pprev)->next) {
for (pprev = fam_handlers(family); *pprev; pprev = &(*pprev)->next) {
if (*pprev == handler) {
*pprev = handler->next;
ret = 0;
Expand Down

0 comments on commit 6fcb5a1

Please sign in to comment.