162 { ETH_P_803_3, 0 },
163 };
164
165 /*
166 * This sets an upper bound on the size of the receive buffer for a PF_PACKET
167 * socket. More properly, this should be controlled through ipadm, ala TCP, UDP,
168 * SCTP, etc. Until that's done, this provides a hard cap of 4 MB and allows an
169 * opportunity for it to be changed, should it be needed.
170 */
171 int sockmod_pfp_rcvbuf_max = 1024 * 1024 * 4;
172
173 /*
174 * Module linkage information for the kernel.
175 */
176 static struct modlsockmod modlsockmod = {
177 &mod_sockmodops, "PF Packet socket module", &sinfo
178 };
179
180 static struct modlinkage modlinkage = {
181 MODREV_1,
182 &modlsockmod,
183 NULL
184 };
185
186 int
187 _init(void)
188 {
189 int error;
190
191 error = sockpfp_init();
192 if (error != 0)
193 return (error);
194
195 error = mod_install(&modlinkage);
196 if (error != 0)
197 sockpfp_fini();
198
199 return (error);
200 }
201
202 int
203 _fini(void)
|
162 { ETH_P_803_3, 0 },
163 };
164
165 /*
166 * This sets an upper bound on the size of the receive buffer for a PF_PACKET
167 * socket. More properly, this should be controlled through ipadm, ala TCP, UDP,
168 * SCTP, etc. Until that's done, this provides a hard cap of 4 MB and allows an
169 * opportunity for it to be changed, should it be needed.
170 */
171 int sockmod_pfp_rcvbuf_max = 1024 * 1024 * 4;
172
173 /*
174 * Module linkage information for the kernel.
175 */
176 static struct modlsockmod modlsockmod = {
177 &mod_sockmodops, "PF Packet socket module", &sinfo
178 };
179
180 static struct modlinkage modlinkage = {
181 MODREV_1,
182 { &modlsockmod, NULL }
183 };
184
185 int
186 _init(void)
187 {
188 int error;
189
190 error = sockpfp_init();
191 if (error != 0)
192 return (error);
193
194 error = mod_install(&modlinkage);
195 if (error != 0)
196 sockpfp_fini();
197
198 return (error);
199 }
200
201 int
202 _fini(void)
|