add: atexit(ethernet_cleanup);
context: static int ethernet_bind(struct sockaddr *eth_addr, char *interface_name){    int sock_fd = -1; // return value    int uid = 0;    /* check to see if we are being run as root */    uid = getuid();    if (uid != 0) {                     fprintf(stderr,            "ethernet: Unable to open an 802.2 socket.  "            "Try running with root priveleges.\n");        return sock_fd;    }    /* Attempt to open the socket for 802.2 ethernet frames */    if ((sock_fd = socket(AF_INET, SOCK_PACKET, htons(ETH_P_802_2))) < 0)    {        /* Error occured */        fprintf(stderr,            "ethernet: Error opening socket : %s\n",            strerror(errno));        exit(-1);    }    /* Bind the socket to an address */    eth_addr->sa_family = AF_UNIX;    /* Clear the memory before copying */    memset(eth_addr->sa_data, '\0', sizeof(struct sockaddr_in));    /* Strcpy the interface name into the address */    strncpy(eth_addr->sa_data, interface_name, IFNAMSIZ);    /* Attempt to bind the socket to the interface */    if (bind(sock_fd, eth_addr, sizeof(struct sockaddr)) != 0)    {        /* Bind problem, close socket and return */        fprintf(stderr,            "ethernet: Unable to bind 802.2 socket : %s\n",            strerror(errno));        /* Close the socket */        close(sock_fd);        exit(-1);    }    return sock_fd;}