[ 2025 | 2024 | 2023 | 2022 | 2021 | 2020 | 2019 | 2018 | 2017 | 2016 | 2015 | 2014 | 2013 | 2012 | 2011 ]
2025-05-06: 続いて run(4) の HostAP 対応に取り組んでいた。対応している FreeBSD から差分を取り込んでみるも、動かず断念。athn(4) で動きそうな AR9271 の USB をメルカリでゲットして、IN-1 に挿して使用する作戦にする。
2025-04-27: j2k25 の WiFi ルータ作りのため、 skynew IN-2+ をゲット。 skynew は IN-1 は少し雑な印象だったけど、IN-2+ はちゃんとしてる印象。サ ポートの反応も早く、ハードウェアの部品名とかも購入前に教えてもらえた。
2025-04-27: 11ac と hostap 両方をサポートするのは bwfm しかないので、 m2 な BCM4356 をゲットして換装。5Ghz が有効にならず一日悩んでいたが、regulatory domain が起動時が ID (Indonesia) になっていた。JP に変更すれば 5Ghz 帯域が有効 となる。
diff --git a/sys/dev/ic/bwfm.c b/sys/dev/ic/bwfm.c index 5f380f72456..1ae13541e01 100644 --- a/sys/dev/ic/bwfm.c +++ b/sys/dev/ic/bwfm.c @@ -249,6 +249,11 @@ bwfm_preinit(struct bwfm_softc *sc) struct ifnet *ifp = &ic->ic_if; int i, j, nbands, nmode, vhtmode; uint32_t bandlist[3], tmp; + struct { + char ccode0[4]; + uint32_t rev; + char ccode1[4]; + } regccode = { "JP", 0, "JP" }; if (sc->sc_initialized) return 0; @@ -266,6 +271,11 @@ bwfm_preinit(struct bwfm_softc *sc) printf("%s: address %s\n", DEVNAME(sc), ether_sprintf(ic->ic_myaddr)); + if (bwfm_fwvar_var_set_data(sc, "country", ®ccode, sizeof(regccode)) + != 0) + printf("%s: %s setting country failed\n", __func__, + ifp->if_xname); + bwfm_process_blob(sc, "clmload", &sc->sc_clm, &sc->sc_clmsize); bwfm_process_blob(sc, "txcapload", &sc->sc_txcap, &sc->sc_txcapsize); bwfm_process_blob(sc, "calload", &sc->sc_cal, &sc->sc_calsize);
これをきちんとた修正とするにはどうした良いのだろう。 FreeBSD は ifconfig に country という設定があり、Linux でも iw で同様のことができる ようだ。しかし、 regulatory domain を利用者が変更することは、US と日本で は禁止されているらしい。単に country code を設定するだけの実装は容易だと 思うけど、いろいろと議論がありそう。
2025-04-27: ざっくり fast.com で測定すると 11n は 20Mbps、11ac は 60Mbps。 ただし、横の Buffalo では 11ac で 200Mbps+ でるので市販のものとは差がある。
有線 LAN にブリッジする設定をさらしておく。
/etc/hostname.bwfm0:
mode 11ac mediaopt hostap nwid Buggy_5G chan 124 wpakey AAAAAAAA up
/etc/hostname.veb0:
add re0 add bwfm0 add vport0 up
/etc/hostname.vport0:
inet autoconf inet6 autoconf up
/etc/hostname.re0:
up
2025-04-12: isalpha(3) などの引数が負だった場合を考慮して、char は unsigned char にキャストする必要があるかどうかだけど、実際には OpenBSD や glibc ではその必要はないと思う。wchar_t とかない昔、たとえば 4.3 BSD Reno の実装 (*1 *2) は要素数 256 個 の配列を使って判定したので、実際に配列の引数にマイナスを渡すことになり、不正な メモリアクセスとなっていたけど。 改めて C99 を確認すると
In all cases the argument is an int, the value of which shall be representable as an unsigned char or shall equal the value of the macro EOF. If the argument has any other value, the behavior is undefined.
不定と明記されている。
2025-04-10: https://cloudzy.com/ で OpenBSD を動かしてみている。 米国ダラスのサーバで $5/month ぐらいで動かせる
2025-04-09: Lua 4.7 Handling Yields in C の 日本語訳 してみた
2025-04-02: libcurl を libevent で使うときの glue https://github.com/yasuoka/curl_libevent Windows 対応 :)
2025-03-29: curl_libevent.c にバグがあったので直した https://gist.github.com/yasuoka/f00aa761bd5eb19ea11b7c0aabc52173/revisions
2025-02-18: mewl を mime decode に対応した diff があるけど、どうしようか な
2025-02-18: https://www.google.com/search?q=b64_pton で https://github.com/yasuoka/b64_pton が上がっている気がする。
2025-02-07: sin_port と sin6_port のオフセットが同一であると仮定すること について copilot に相談すると、
的な回答で、これに対し、メンバーが定義されていても順番はこのとおりにしろとか 書いてないから明示的に同じであるという定義はしてないのでは? と突っ込むと、
的な回答で、なかなか。
2025-02-06: https://openbsd.cs.toronto.edu/archive/ snapshot のアーカイブ
2025-01-05: 超忙しいけど、こんだけ頻繁に CPU 回されたんじゃ、デバッグせ ざるを得ないな
87845 _relayd 64 0 1716K 3584K run - 401:44 33.11% relayd 27654 _relayd 64 0 1712K 3576K run - 81:55 32.91% relayd 98261 _relayd 64 0 1712K 3604K run - 609:56 31.64% relayd $ doas sh -x 1 + kill -ABRT 87845 27654 98261 $ ls -la /var/crash/relayd total 8968 drwxr-xr-x 2 root wheel 512 Jan 5 13:37 . drwxrwx--- 3 root wheel 512 Jan 5 13:35 .. -rw------- 1 root wheel 1502536 Jan 5 13:37 27654.core -rw------- 1 root wheel 1506240 Jan 5 13:37 87845.core -rw------- 1 root wheel 1516280 Jan 5 13:37 98261.core $
2025-01-02: 1週間ほど、サーバ止まってた... IPv6 はプロキシ挟まないから 影響なかった。監視からずっとアラート出つづけてたけど、スルーしてた。いくら 忙しくても、ダメすぎる..