diff options
author | Denis Vlasenko | 2008-06-04 07:59:51 +0000 |
---|---|---|
committer | Denis Vlasenko | 2008-06-04 07:59:51 +0000 |
commit | 3b162ecdf6955e9610ec051e21b91a3efe48a030 (patch) | |
tree | b2b3e75e8dfb4e32fc4d67af5682ed4ea8b800bd /networking/interface.c | |
parent | 630a7f75e836b2d8669e571af9c5aa5b180c6ca8 (diff) | |
download | busybox-3b162ecdf6955e9610ec051e21b91a3efe48a030.zip busybox-3b162ecdf6955e9610ec051e21b91a3efe48a030.tar.gz |
networking/interface.c: fix indentation
Diffstat (limited to 'networking/interface.c')
-rw-r--r-- | networking/interface.c | 100 |
1 files changed, 49 insertions, 51 deletions
diff --git a/networking/interface.c b/networking/interface.c index abd58b5..efae03b 100644 --- a/networking/interface.c +++ b/networking/interface.c @@ -680,7 +680,6 @@ static int if_fetch(struct interface *ife) return 0; } - static int do_if_fetch(struct interface *ife) { if (if_fetch(ife) < 0) { @@ -1217,63 +1216,62 @@ static int if_print(char *ifname) /* Input an Infiniband address and convert to binary. */ int in_ib(const char *bufp, struct sockaddr *sap) { - unsigned char *ptr; - char c; - const char *orig; - int i; - unsigned val; - - sap->sa_family = ib_hwtype.type; - ptr = (unsigned char *) sap->sa_data; - - i = 0; - orig = bufp; - while ((*bufp != '\0') && (i < INFINIBAND_ALEN)) { - val = 0; - c = *bufp++; - if (isdigit(c)) - val = c - '0'; - else if (c >= 'a' && c <= 'f') - val = c - 'a' + 10; - else if (c >= 'A' && c <= 'F') - val = c - 'A' + 10; - else { - errno = EINVAL; - return (-1); - } - val <<= 4; - c = *bufp; - if (isdigit(c)) - val |= c - '0'; - else if (c >= 'a' && c <= 'f') - val |= c - 'a' + 10; - else if (c >= 'A' && c <= 'F') - val |= c - 'A' + 10; - else if (c == ':' || c == 0) - val >>= 4; - else { - errno = EINVAL; - return (-1); - } - if (c != 0) - bufp++; - *ptr++ = (unsigned char) (val & 0377); - i++; - - /* We might get a semicolon here - not required. */ - if (*bufp == ':') { - bufp++; + unsigned char *ptr; + char c; + const char *orig; + int i; + unsigned val; + + sap->sa_family = ib_hwtype.type; + ptr = (unsigned char *) sap->sa_data; + + i = 0; + orig = bufp; + while ((*bufp != '\0') && (i < INFINIBAND_ALEN)) { + val = 0; + c = *bufp++; + if (isdigit(c)) + val = c - '0'; + else if (c >= 'a' && c <= 'f') + val = c - 'a' + 10; + else if (c >= 'A' && c <= 'F') + val = c - 'A' + 10; + else { + errno = EINVAL; + return -1; + } + val <<= 4; + c = *bufp; + if (isdigit(c)) + val |= c - '0'; + else if (c >= 'a' && c <= 'f') + val |= c - 'a' + 10; + else if (c >= 'A' && c <= 'F') + val |= c - 'A' + 10; + else if (c == ':' || c == 0) + val >>= 4; + else { + errno = EINVAL; + return -1; + } + if (c != 0) + bufp++; + *ptr++ = (unsigned char) (val & 0377); + i++; + + /* We might get a semicolon here - not required. */ + if (*bufp == ':') { + bufp++; + } } - } #ifdef DEBUG -fprintf(stderr, "in_ib(%s): %s\n", orig, UNSPEC_print(sap->sa_data)); + fprintf(stderr, "in_ib(%s): %s\n", orig, UNSPEC_print(sap->sa_data)); #endif - return (0); + return 0; } #endif - int display_interfaces(char *ifname) { int status; |