Fix RTMP broadcast

This commit is contained in:
Josh Deprez 2024-04-07 15:25:30 +10:00
parent 07ea3688d5
commit e75639a317
Signed by: josh
SSH key fingerprint: SHA256:zZji7w1Ilh2RuUpbQcqkLPrqmRwpiCSycbF2EfKm6Kw
2 changed files with 6 additions and 5 deletions

View file

@ -198,12 +198,11 @@ func main() {
switch ethFrame.SNAPProto {
case ethertalk.AARPProto:
log.Print("Got an AARP frame")
// log.Print("Got an AARP frame")
aarpCh <- ethFrame
case ethertalk.AppleTalkProto:
log.Print("Got an AppleTalk frame")
// log.Print("Got an AppleTalk frame")
var ddpkt ddp.ExtPacket
if err := ddp.ExtUnmarshal(ethFrame.Payload, &ddpkt); err != nil {
log.Printf("Couldn't unmarshal DDP packet: %v", err)

View file

@ -60,7 +60,8 @@ func (m *RTMPMachine) Run(ctx context.Context) error {
ddpPkt := ddp.ExtPacket{
ExtHeader: ddp.ExtHeader{
Size: uint16(len(dataPktRaw)),
DstNet: 0,
Cksum: 0,
DstNet: 0, // this network
DstNode: 0xff, // broadcast packet
DstSocket: 1, // the special RTMP socket
SrcNet: myAddr.Proto.Network,
@ -71,10 +72,11 @@ func (m *RTMPMachine) Run(ctx context.Context) error {
Data: dataPktRaw,
}
ethFrame, err := ethertalk.AppleTalk(ethertalk.AppleTalkBroadcast, ddpPkt)
ethFrame, err := ethertalk.AppleTalk(myAddr.Hardware, ddpPkt)
if err != nil {
log.Printf("RTMP: Couldn't create EtherTalk frame: %v", err)
}
ethFrame.Dst = ethertalk.AppleTalkBroadcast
ethFrameRaw, err := ethertalk.Marshal(*ethFrame)
if err != nil {