~ubuntu-branches/ubuntu/karmic/dante/karmic

« back to all changes in this revision

Viewing changes to sockd/getifa.c

  • Committer: Bazaar Package Importer
  • Author(s): Adrian Bridgett
  • Date: 2003-11-15 18:59:33 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20031115185933-vkxgk8f226ovwmrh
Tags: 1.1.14-2
improve extended descriptions (closes: #209510, #210116)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * $Id: getifa.c,v 1.27 2001/12/12 14:42:18 karls Exp $
 
2
 * $Id: getifa.c,v 1.30 2003/07/01 13:21:40 michaels Exp $
3
3
 *
4
 
 * Copyright (c) 2001
 
4
 * Copyright (c) 2001, 2002, 2003
5
5
 *      Inferno Nettverk A/S, Norway.  All rights reserved.
6
6
 *
7
7
 * Redistribution and use in source and binary forms, with or without
50
50
#include "common.h"
51
51
 
52
52
static const char rcsid[] =
53
 
"$Id: getifa.c,v 1.27 2001/12/12 14:42:18 karls Exp $";
 
53
"$Id: getifa.c,v 1.30 2003/07/01 13:21:40 michaels Exp $";
54
54
 
55
55
 
56
56
/*===========================================================================
105
105
        uid_t euid;
106
106
        struct in_addr inaddr_none;
107
107
 
108
 
#if !DEBUG
109
108
        if (sockscf.external.addrc <= 1
110
109
        ||  sockscf.external.rotation == ROTATION_NONE)
111
110
                return getdefaultexternal();
112
 
#endif
113
111
 
114
112
        inaddr_none.s_addr = htonl(INADDR_NONE);
115
113
 
122
120
 
123
121
        if (rtnetlink_sk == -1) {
124
122
                swarn("%s: socket(NETLINK_ROUTE)", function);
125
 
                close(rtnetlink_sk);
126
 
                return inaddr_none;
 
123
                return getdefaultexternal();
127
124
        }
128
125
 
129
126
        /*===================================================================
241
238
 
242
239
        inaddr_none.s_addr = htonl(INADDR_NONE);
243
240
 
244
 
#if !DEBUG
245
241
        if (sockscf.external.addrc <= 1
246
242
        ||  sockscf.external.rotation == ROTATION_NONE)
247
243
                return getdefaultexternal();
248
 
#endif
249
244
 
250
245
        /*===================================================================
251
246
         * Get a socket.
428
423
                        break;
429
424
        }
430
425
 
431
 
        if (i == sockscf.external.addrc) {
432
 
                char a[MAXSOCKADDRSTRING];
433
 
 
434
 
                swarnx("%s: %s selected for connection but not on external list",
435
 
                function, sockaddr2string(addr, a, sizeof(a)));
 
426
        if (i == sockscf.external.addrc)
436
427
                return 0;
437
 
        }
438
428
 
439
429
        return 1;
440
430
}