ObjFW  Check-in [d6812c8d19]

Overview
Comment:utils/ofatalkcfg: Recommend "modprobe appletalk"
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d6812c8d192ac3e5500b56f50a40eaa93aab3e6c673cae39aad5f5902f2c80da
User & Date: js on 2023-04-12 07:31:50
Other Links: manifest | tags
Context
2023-04-12
07:47
utils/ofatalkcfg: Add default phase and range check-in: a143f67237 user: js tags: trunk
07:31
utils/ofatalkcfg: Recommend "modprobe appletalk" check-in: d6812c8d19 user: js tags: trunk
06:54
Make utils/ofatalkcfg work on NetBSD check-in: e27b645562 user: js tags: trunk
Changes

Modified utils/ofatalkcfg/OFATalkCfg.m from [af3b7cdc64] to [d5f21c75e8].

10
11
12
13
14
15
16


17
18
19
20
21
22
23
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25







+
+







 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#include "config.h"

#include <errno.h>

#ifdef HAVE_NET_IF_H
# include <net/if.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
#endif
62
63
64
65
66
67
68


69
70
71








72
73
74
75
76
77
78
64
65
66
67
68
69
70
71
72
73
74

75
76
77
78
79
80
81
82
83
84
85
86
87
88
89







+
+


-
+
+
+
+
+
+
+
+







	sat->sat_node = node;
	nr = (__typeof__(nr))(void *)sat->sat_zero;
	nr->nr_phase = phase;
	nr->nr_firstnet = OFToBigEndian16(rangeStart);
	nr->nr_lastnet = OFToBigEndian16(rangeEnd);

	if ((sock = socket(AF_APPLETALK, SOCK_DGRAM, 0)) < 0) {
		int errNo = OFSocketErrNo();

		[OFStdErr writeFormat: @"%@: Failed to create socket: %@\n",
				       [OFApplication programName],
				       OFStrError(OFSocketErrNo())];
				       OFStrError(errNo)];

#ifdef OF_LINUX
		if (errNo == EAFNOSUPPORT)
			[OFStdErr writeLine: @"Did you forget to run "
					     @"\"modprobe appletalk\"?"];
#endif

		[OFApplication terminateWithStatus: 1];
	}

	if (ioctl(sock, SIOCSIFADDR, &request) != 0) {
		[OFStdErr writeFormat: @"%@: Failed to set address: %@\n",
				       [OFApplication programName],
				       OFStrError(OFSocketErrNo())];