diff options
author | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-08-27 08:30:07 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-08-27 08:30:07 -0400 |
commit | efda9452046bdd707b23a85b7846ec33548f84f1 (patch) | |
tree | f08c915049ea1829ba115cd41a0ba28ddf184e07 /net/ax25/ax25_route.c | |
parent | b01f2cc1c37ac3d5ca313c90370a586dffe5aca9 (diff) | |
parent | 36676bcbf9f6bcbea9d06e67ee8d04eacde54952 (diff) |
Merge with master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'net/ax25/ax25_route.c')
-rw-r--r-- | net/ax25/ax25_route.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/net/ax25/ax25_route.c b/net/ax25/ax25_route.c index 44b99b1ff9f8..c288526da4ce 100644 --- a/net/ax25/ax25_route.c +++ b/net/ax25/ax25_route.c | |||
@@ -422,8 +422,8 @@ static inline void ax25_adjust_path(ax25_address *addr, ax25_digi *digipeat) | |||
422 | */ | 422 | */ |
423 | int ax25_rt_autobind(ax25_cb *ax25, ax25_address *addr) | 423 | int ax25_rt_autobind(ax25_cb *ax25, ax25_address *addr) |
424 | { | 424 | { |
425 | ax25_uid_assoc *user; | ||
425 | ax25_route *ax25_rt; | 426 | ax25_route *ax25_rt; |
426 | ax25_address *call; | ||
427 | int err; | 427 | int err; |
428 | 428 | ||
429 | if ((ax25_rt = ax25_get_route(addr, NULL)) == NULL) | 429 | if ((ax25_rt = ax25_get_route(addr, NULL)) == NULL) |
@@ -434,16 +434,18 @@ int ax25_rt_autobind(ax25_cb *ax25, ax25_address *addr) | |||
434 | goto put; | 434 | goto put; |
435 | } | 435 | } |
436 | 436 | ||
437 | if ((call = ax25_findbyuid(current->euid)) == NULL) { | 437 | user = ax25_findbyuid(current->euid); |
438 | if (user) { | ||
439 | ax25->source_addr = user->call; | ||
440 | ax25_uid_put(user); | ||
441 | } else { | ||
438 | if (ax25_uid_policy && !capable(CAP_NET_BIND_SERVICE)) { | 442 | if (ax25_uid_policy && !capable(CAP_NET_BIND_SERVICE)) { |
439 | err = -EPERM; | 443 | err = -EPERM; |
440 | goto put; | 444 | goto put; |
441 | } | 445 | } |
442 | call = (ax25_address *)ax25->ax25_dev->dev->dev_addr; | 446 | ax25->source_addr = *(ax25_address *)ax25->ax25_dev->dev->dev_addr; |
443 | } | 447 | } |
444 | 448 | ||
445 | ax25->source_addr = *call; | ||
446 | |||
447 | if (ax25_rt->digipeat != NULL) { | 449 | if (ax25_rt->digipeat != NULL) { |
448 | if ((ax25->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) { | 450 | if ((ax25->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) { |
449 | err = -ENOMEM; | 451 | err = -ENOMEM; |