ipsockopt.c (e52a7d1f39a4cf98eabafe2286bcefe17583db56) ipsockopt.c (71498f308b2324dbd94e94fd8c4ae41bf4bd663b)
1/*-
2 * Copyright (c) 2004 Robert N. M. Watson
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 665 unchanged lines hidden (view full) ---

674 /* be deterministic (for automated operation) */
675 basegroup = 0xEE010100; /* 238.1.1.0 */
676 }
677 /*
678 * Join the multicast group(s) on the default multicast interface;
679 * this usually maps to the interface to which the default
680 * route is pointing.
681 */
1/*-
2 * Copyright (c) 2004 Robert N. M. Watson
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 665 unchanged lines hidden (view full) ---

674 /* be deterministic (for automated operation) */
675 basegroup = 0xEE010100; /* 238.1.1.0 */
676 }
677 /*
678 * Join the multicast group(s) on the default multicast interface;
679 * this usually maps to the interface to which the default
680 * route is pointing.
681 */
682 for (i = 0; i < nmcastgroups; i++) {
682 for (i = 1; i < nmcastgroups+1; i++) {
683 mreq.imr_multiaddr.s_addr = htonl((basegroup + i));
684 mreq.imr_interface.s_addr = INADDR_ANY;
685 inet_ntop(AF_INET, &mreq.imr_multiaddr, addrbuf, sizeof(addrbuf));
686 if (verbose)
687 fprintf(stderr, "IP_ADD_MEMBERSHIP %s INADDR_ANY\n", addrbuf);
688 if (setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq,
689 sizeof(mreq)) < 0) {
690 err(-1,
691"test_ip_multicast_membership(%d, %s): failed IP_ADD_MEMBERSHIP (%s, %s)",
692 sock, socktypename, addrbuf, "INADDR_ANY");
693 }
694 }
683 mreq.imr_multiaddr.s_addr = htonl((basegroup + i));
684 mreq.imr_interface.s_addr = INADDR_ANY;
685 inet_ntop(AF_INET, &mreq.imr_multiaddr, addrbuf, sizeof(addrbuf));
686 if (verbose)
687 fprintf(stderr, "IP_ADD_MEMBERSHIP %s INADDR_ANY\n", addrbuf);
688 if (setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq,
689 sizeof(mreq)) < 0) {
690 err(-1,
691"test_ip_multicast_membership(%d, %s): failed IP_ADD_MEMBERSHIP (%s, %s)",
692 sock, socktypename, addrbuf, "INADDR_ANY");
693 }
694 }
695 for (i = 0; i < nmcastgroups; i++) {
695 for (i = 1; i < nmcastgroups+1; i++) {
696 mreq.imr_multiaddr.s_addr = htonl((basegroup + i));
697 mreq.imr_interface.s_addr = INADDR_ANY;
698 inet_ntop(AF_INET, &mreq.imr_multiaddr, addrbuf, sizeof(addrbuf));
699 if (verbose)
700 fprintf(stderr, "IP_DROP_MEMBERSHIP %s INADDR_ANY\n", addrbuf);
701 if (setsockopt(sock, IPPROTO_IP, IP_DROP_MEMBERSHIP, &mreq,
702 sizeof(mreq)) < 0) {
703 err(-1,

--- 240 unchanged lines hidden ---
696 mreq.imr_multiaddr.s_addr = htonl((basegroup + i));
697 mreq.imr_interface.s_addr = INADDR_ANY;
698 inet_ntop(AF_INET, &mreq.imr_multiaddr, addrbuf, sizeof(addrbuf));
699 if (verbose)
700 fprintf(stderr, "IP_DROP_MEMBERSHIP %s INADDR_ANY\n", addrbuf);
701 if (setsockopt(sock, IPPROTO_IP, IP_DROP_MEMBERSHIP, &mreq,
702 sizeof(mreq)) < 0) {
703 err(-1,

--- 240 unchanged lines hidden ---