Ignore:
Timestamp:
Dec 20, 2016, 4:07:32 PM (7 years ago)
Author:
Bruno Cornec
Message:

New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.

Location:
branches/3.3
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi-busybox/networking/brctl.c

    r3232 r3621  
    6565
    6666#if ENABLE_FEATURE_BRCTL_FANCY
    67 # include <linux/if_bridge.h>
     67/* #include <linux/if_bridge.h>
     68 * breaks on musl: we already included netinet/in.h in libbb.h,
     69 * if we include <linux/if_bridge.h> here, we get this:
     70 * In file included from /usr/include/linux/if_bridge.h:18,
     71 *                  from networking/brctl.c:67:
     72 * /usr/include/linux/in6.h:32: error: redefinition of 'struct in6_addr'
     73 * /usr/include/linux/in6.h:49: error: redefinition of 'struct sockaddr_in6'
     74 * /usr/include/linux/in6.h:59: error: redefinition of 'struct ipv6_mreq'
     75 */
     76/* From <linux/if_bridge.h> */
     77#define BRCTL_GET_VERSION 0
     78#define BRCTL_GET_BRIDGES 1
     79#define BRCTL_ADD_BRIDGE 2
     80#define BRCTL_DEL_BRIDGE 3
     81#define BRCTL_ADD_IF 4
     82#define BRCTL_DEL_IF 5
     83#define BRCTL_GET_BRIDGE_INFO 6
     84#define BRCTL_GET_PORT_LIST 7
     85#define BRCTL_SET_BRIDGE_FORWARD_DELAY 8
     86#define BRCTL_SET_BRIDGE_HELLO_TIME 9
     87#define BRCTL_SET_BRIDGE_MAX_AGE 10
     88#define BRCTL_SET_AGEING_TIME 11
     89#define BRCTL_SET_GC_INTERVAL 12
     90#define BRCTL_GET_PORT_INFO 13
     91#define BRCTL_SET_BRIDGE_STP_STATE 14
     92#define BRCTL_SET_BRIDGE_PRIORITY 15
     93#define BRCTL_SET_PORT_PRIORITY 16
     94#define BRCTL_SET_PATH_COST 17
     95#define BRCTL_GET_FDB_ENTRIES 18
     96struct __bridge_info {
     97    uint64_t designated_root;
     98    uint64_t bridge_id;
     99    uint32_t root_path_cost;
     100    uint32_t max_age;
     101    uint32_t hello_time;
     102    uint32_t forward_delay;
     103    uint32_t bridge_max_age;
     104    uint32_t bridge_hello_time;
     105    uint32_t bridge_forward_delay;
     106    uint8_t  topology_change;
     107    uint8_t  topology_change_detected;
     108    uint8_t  root_port;
     109    uint8_t  stp_enabled;
     110    uint32_t ageing_time;
     111    uint32_t gc_interval;
     112    uint32_t hello_timer_value;
     113    uint32_t tcn_timer_value;
     114    uint32_t topology_change_timer_value;
     115    uint32_t gc_timer_value;
     116};
     117/* end <linux/if_bridge.h> */
    68118
    69119/* FIXME: These 4 funcs are not really clean and could be improved */
     
    79129    if (sscanf(time_str, "%lf", &secs) != 1)
    80130# endif
    81         bb_error_msg_and_die(bb_msg_invalid_arg, time_str, "timespec");
     131        bb_error_msg_and_die(bb_msg_invalid_arg_to, time_str, "timespec");
    82132    tv->tv_sec = secs;
    83133    tv->tv_usec = 1000000 * (secs - tv->tv_sec);
     
    156206        key = index_in_strings(keywords, *argv);
    157207        if (key == -1) /* no match found in keywords array, bail out. */
    158             bb_error_msg_and_die(bb_msg_invalid_arg, *argv, applet_name);
     208            bb_error_msg_and_die(bb_msg_invalid_arg_to, *argv, applet_name);
    159209        argv++;
    160210        fd = xsocket(AF_INET, SOCK_STREAM, 0);
     
    168218                        (unsigned long) bridx, MAX_PORTS);
    169219            num = xioctl(fd, SIOCGIFBR, args);
    170             printf("bridge name\tbridge id\t\tSTP enabled\tinterfaces\n");
     220            puts("bridge name\tbridge id\t\tSTP enabled\tinterfaces");
    171221            for (i = 0; i < num; i++) {
    172222                char ifname[IFNAMSIZ];
     
    187237                x = (unsigned char *) &bi.bridge_id;
    188238                for (j = 0; j < 8; j++) {
    189                     printf("%.2x", x[j]);
     239                    printf("%02x", x[j]);
    190240                    if (j == 1)
    191241                        bb_putchar('.');
     
    250300            int onoff = index_in_strings(no_yes, *argv);
    251301            if (onoff < 0)
    252                 bb_error_msg_and_die(bb_msg_invalid_arg, *argv, applet_name);
     302                bb_error_msg_and_die(bb_msg_invalid_arg_to, *argv, applet_name);
    253303            onoff = (unsigned)onoff / 4;
    254304            arm_ioctl(args, BRCTL_SET_BRIDGE_STP_STATE, onoff, 0);
     
    283333                port = if_nametoindex(*argv++);
    284334                if (!port)
    285                     bb_error_msg_and_die(bb_msg_invalid_arg, *argv, "port");
     335                    bb_error_msg_and_die(bb_msg_invalid_arg_to, *argv, "port");
    286336                memset(ifidx, 0, sizeof ifidx);
    287337                arm_ioctl(args, BRCTL_GET_PORT_LIST, (unsigned long)ifidx,
Note: See TracChangeset for help on using the changeset viewer.